package com.lixiang.controller;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.hy.corecode.idgen.WFGIdGenerator;
import com.hy.corecode.idgen.YitIdGenerator;
import com.lixiang.entity.HyId;
import com.lixiang.mapper.HyIdMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @Autowired
    private WFGIdGenerator wfgIdGenerator;

    @Autowired
    private HyIdMapper hyIdMapper;

    @Autowired
    private IdentifierGenerator identifierGenerator;

    @GetMapping("getId")
    public Long getId(){
        return wfgIdGenerator.next();
    }

    @GetMapping("insertId")
    public int InsertId(){
        HyId hyId = new HyId();
        hyId.setName("测试");
        return hyIdMapper.insert(hyId);
//        return (Long) identifierGenerator.nextId(hyId);
    }
}
